package p270jp.pxv.android.viewholder;

import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import p045be.AbstractNovelListAdapter;
import p045be.NewNovelListAdapter;
import p045be.NovelListAdapter;
import p134ei.AnalyticsAreaName;
import p134ei.AnalyticsScreenName;
import p184gi.FirebaseScreenNameVia;
import p270jp.pxv.android.R;
import p270jp.pxv.android.activity.UserWorkActivity;
import p270jp.pxv.android.commonObjects.model.WorkType;
import p270jp.pxv.android.legacy.model.PixivNovel;
import p270jp.pxv.android.model.PixivProfile;
import p307l9.EdgeTreatment;
import p374nm.UserProfileContentsView;
import p451qm.NovelItemDecoration;

/* renamed from: jp.pxv.android.viewholder.UserProfileNovelViewHolder */
/* loaded from: classes2.dex */
public class UserProfileNovelViewHolder extends RecyclerView.AbstractC0819y {
    private static final int COLUMN_NUM;
    private static final int ROW_NUM;
    private AbstractNovelListAdapter adapter;
    private final long screenId;
    private UserProfileContentsView userProfileContentsView;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    private UserProfileNovelViewHolder(UserProfileContentsView t0Var, boolean z, long j) {
        super(t0Var);
        AnalyticsScreenName cVar = AnalyticsScreenName.USER_PROFILE;
        this.userProfileContentsView = t0Var;
        this.screenId = j;
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this.itemView.getContext());
        NovelItemDecoration hVar = new NovelItemDecoration(this.itemView.getContext());
        if (z) {
            this.adapter = new NewNovelListAdapter(this.itemView.getContext(), AnalyticsAreaName.USER_WORK_NOVEL, true, new FirebaseScreenNameVia(cVar, 8));
        } else {
            this.adapter = new NovelListAdapter(this.itemView.getContext(), new FirebaseScreenNameVia(cVar, 8), j);
        }
        t0Var.m3326a(linearLayoutManager, hVar, this.adapter);
    }

    public static UserProfileNovelViewHolder createViewHolderByParentView(ViewGroup viewGroup, boolean z, long j) {
        return new UserProfileNovelViewHolder(new UserProfileContentsView(viewGroup.getContext()), z, j);
    }

    public /* synthetic */ void lambda$onBindViewHolder$0(long j, PixivProfile pixivProfile, View view) {
        this.itemView.getContext().startActivity(UserWorkActivity.m4686e1(this.itemView.getContext(), j, pixivProfile, WorkType.NOVEL));
    }

    public void onBindViewHolder(long j, PixivProfile pixivProfile, List<PixivNovel> list) {
        EdgeTreatment.m3909i(pixivProfile);
        EdgeTreatment.m3909i(list);
        this.userProfileContentsView.setTitleText(this.itemView.getContext().getString(R.string.user_profile_work_novel));
        UserProfileContentsView t0Var = this.userProfileContentsView;
        t0Var.setReadMoreText(String.valueOf(pixivProfile.totalNovels) + this.itemView.getContext().getString(R.string.user_profile_works_count));
        this.userProfileContentsView.setReadMoreTextClickListener(new View.OnClickListener(j, pixivProfile) { // from class: jp.pxv.android.viewholder.n

            /* renamed from: b */
            public final /* synthetic */ long f19777b;

            /* renamed from: c */
            public final /* synthetic */ PixivProfile f19778c;

            {
                this.f19777b = r2;
                this.f19778c = r4;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                UserProfileNovelViewHolder.this.lambda$onBindViewHolder$0(this.f19777b, this.f19778c, view);
            }
        });
        this.adapter.mo10324r(list.subList(0, Math.min(3, list.size())));
        this.adapter.f3606a.m10780b();
        this.userProfileContentsView.m3325b(list, 3, 2);
    }
}
